package CollectionArraysTool;

import java.util.Arrays;

public class Demon02 {
    public static void main(String[] args) {
      int [] arr=new int[]{3,2,3,114,6};
        Arrays.sort(arr);
        for(int i=0;i<arr.length;i++)
        {
            System.out.println(arr[i]);
        }
        //使用二分法Arrays.binarySearch前提是已经排好序
        int position = Arrays.binarySearch(arr, 6);
        System.out.println(position);
    }
}
